package io.renren.modules.sys.back.service.impl;

import io.renren.modules.sys.back.dao.BtNavBarDao;
import io.renren.modules.sys.back.entity.BtNavBarEntity;
import io.renren.modules.sys.back.service.BtNavBarService;
import io.renren.modules.sys.back.vo.NavBarCVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;


@Service("btNavBarService")
public class BtNavBarServiceImpl extends ServiceImpl<BtNavBarDao, BtNavBarEntity> implements BtNavBarService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Long pid = Long.parseLong((String) params.get("pid"));
        Page<BtNavBarEntity> page = this.selectPage(
                new Query<BtNavBarEntity>(params).getPage(),
                new EntityWrapper<BtNavBarEntity>()
                        .eq( "pid",pid)

        );

        return new PageUtils(page);
    }
    public List<NavBarCVo> getCategroyZtree(){
        return baseMapper.getCategroyZtree();
    }
    public Integer  hadSubCount(Long id){
        return baseMapper.hadSubCount(id);
    }
}
